home *** CD-ROM | disk | FTP | other *** search
/ PC World 2000 February / PCWorld_2000-02_cd.bin / Software / Vyzkuste / xsetup / _SETUP.2 / Group3 / XQ Explorer Drive Hide.xpl < prev    next >
Text File  |  1999-09-14  |  3KB  |  114 lines

  1. "FILE"="Xteq Systems X-Setup Plugin 5.0"
  2. "TYPE"="6"
  3. "COUNT"="5"
  4. "UIPATH"="Appearance\Explorer\Options"
  5. "NAME"="Hide Drives"
  6. "VERSION"="1.40"
  7. "LANGUAGE"="VBScript"
  8. "TEXT 1"="Hide A:\ + B:\"
  9. "TEXT 2"="Hide drive C:\"
  10. "TEXT 3"="Hide drive D:\"
  11. "TEXT 4"="Hide drive E:\"
  12. "TEXT 5"="Hide drive F:\"
  13. "DESCRIPTION 1"="Maybe you don't want that all drives are visible inside the Windows Explorer."
  14. "DESCRIPTION 2"="In this case, simply select the drives that should be hidden and they won't be visible anymore."
  15. "DESCRIPTION 3"="If you are using Internet Explorer 4.0, you need to restart before the changes are visible."
  16. "AUTHOR"="Xteq Systems"
  17. "COPYRIGHT"="Copyright ⌐ Xteq Systems - All Rights Reserved"
  18. "COMMENT 1"="For more information, go to http://www.xteq.com or write to TeXHeX@xteq.com."
  19. "COMMENT 2"=" "
  20. "COMMENT 3"="Thanks to Pierre Szwarc [mailto:szwarc@usa.net] for reporting the "wrong datatype" bug."
  21. "COMMENT 4"="Thanks to Dusty Phillips [dustyphillips@yahoo.com] for reporting the second "wrong datatype" bug."
  22.  
  23. sP="HKCU\Software\Microsoft\Windows\CurrentVersion\Policies\Explorer\"
  24. sV="NoDrives"
  25. i=0
  26. Sub Plugin_Initialize 
  27.  if RegPathExists(sP) then
  28.     i=RegReadValue(sP&sV)
  29.  
  30.     if IsEmpty(i)=true then
  31.        'No drives hiden - don't read anything
  32.     else
  33.        'not empty - check if wrong datatype
  34.        if len(i)>0 and IsNumeric(i)=true then
  35.           if i=0 then
  36.              'no drives hidden
  37.           else
  38.              'drives hidden -> read it
  39.              Call SetUI()
  40.           end if   
  41.        else
  42.           'wrong datatype!!! ignore it!
  43.        end if 
  44.     end if
  45.  
  46.  else
  47.   Disable
  48.  end if
  49. End Sub
  50.  
  51.  
  52. Sub SetUI
  53.    'Arg! We got to calculate!!!
  54.    if (i-32)>=0 then
  55.     Call SetUIElement(5,true)
  56.     i=i-32
  57.    end if
  58.  
  59.    if (i-16)>=0 then
  60.     Call SetUIElement(4,true)
  61.     i=i-16
  62.    end if
  63.  
  64.    if (i-8)>=0 then
  65.     Call SetUIElement(3,true)
  66.     i=i-8
  67.    end if
  68.  
  69.    if (i-4)>=0 then
  70.     Call SetUIElement(2,true)
  71.     i=i-4
  72.    end if
  73.  
  74.    if (i-3)>=0 then
  75.     Call SetUIElement(1,true)
  76.    end if
  77. End Sub
  78.  
  79.  
  80. Sub Plugin_CheckData(ElementIndex)
  81. End Sub
  82.  
  83. Sub Plugin_Apply(ElementIndex,ElementSubIndex)
  84.  i=0
  85.  
  86.  if GetUIElement(1)=true then
  87.   i=i+1+2 'hide B also!
  88.  end if
  89.  
  90.  if GetUIElement(2)=true then
  91.   i=i+4
  92.  end if
  93.  
  94.  if GetUIElement(3)=true then
  95.   i=i+8
  96.  end if
  97.  
  98.  if GetUIElement(4)=true then
  99.   i=i+16
  100.  end if
  101.  
  102.  if GetUIElement(5)=true then
  103.   i=i+32
  104.  end if
  105.  
  106.  Call RegWriteValue(sP & sV,i,2)
  107.  
  108.  'Not needed?
  109.  'Restart
  110. End Sub
  111.  
  112. Sub Plugin_Terminate 
  113. End Sub
  114.